<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="../../js/jquery-1.9.1.min.js"></script>
<script src="../../js/angular.min.js"></script>
<body ng-app="pingmu" ng-controller="pmCtrl">
<table align="center">
    <tr>
        <td style="height: 40px;BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;"></td>
        <td class="zybaobiancss" style="BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">
            {{product.zybaobian}}
        </td>
        <td class="widthcss" style="text-align:center;BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">{{(width-1)*1024}}</td>
        <td class="zybaobiancss" style="BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">
            {{product.zybaobian}}
        </td>
    </tr>
    <tr>
        <td class="sxbaobiancss" style="BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">
            {{product.sxbaobian}}
        </td>
        <td></td>
        <td style="border-bottom: #000000 1px solid;"></td>
        <td style="border-right: #000000 1px solid;"></td>
    </tr>
    <tr>
        <td class="heightcss" style="BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">{{(height-1)*1024}}
        </td>
        <td></td>
        <td style="BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;background-image:url(../static/img/td.jpg);"></td>
        <td style="border-right: #000000 1px solid;"></td>
    </tr>
    <tr>
        <td class="sxbaobiancss" style="BORDER-right: #000000 1px solid;border-bottom: #000000 1px solid;">
            {{product.sxbaobian}}
        </td>
        <td style="border-bottom: #000000 1px solid;"></td>
        <td style="border-bottom: #000000 1px solid;"></td>
        <td style="border-right: #000000 1px solid;border-bottom: #000000 1px solid;"></td>
    </tr>
</table>
</body>
<script src="../../globalVar.js"></script>
<script>
    var app = angular.module('pingmu', []);
    app.controller('pmCtrl', function ($scope, $http) {

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)return unescape(r[2]);
            return null;
        }

        $scope.width = GetQueryString("width");
        $scope.height = GetQueryString("height");

        $scope.token = localStorage.getItem("token");
        var modelId = localStorage.getItem("modelId");
        if (modelId === null) {
            $scope.modelId = 1;
        } else {
            $scope.modelId = modelId
        }


        $http({
            method: "GET",
            url: url + "/product/pingmu?token=" + $scope.token + "&productId=" + $scope.modelId + "&width=" + $scope.width + "&height=" + $scope.height
        }).then(
            function success(response) {
                console.log(response.data.obj);
                $scope.product = response.data.obj;
                $(".zybaobiancss").css("width", parseInt($scope.product.zybaobiancss)/2 + "px");
                $(".widthcss").css("width", parseInt($scope.product.widthcss)/2 + "px");
                $(".sxbaobiancss").css("height", parseInt($scope.product.sxbaobiancss)/2 + "px");
                $(".heightcss").css("height", parseInt($scope.product.heightcss)/2 + "px");
                $(".sxbaobiancss").css("height", parseInt($scope.product.sxbaobiancss)/2 + "px");

            },
            function error(response) {
                location.href = "login.html";
            }
        );



    });
</script>
</html>